import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from './modules/auth/auth.module';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { UserModule } from './modules/user/user.module';
import { RedisModule } from 'nestjs-redis';
import { ClientModule } from './modules/client/client.module';
import { GoodsModule } from './modules/goods/goods.module';

@Module({
  imports: [
    TypeOrmModule.forRoot(),
    RedisModule.register({
      host: '127.0.0.1',
      port: 6379,
    }),
    GraphQLModule.forRoot({
      typePaths: ['./**/*.graphql'],
      context: ({ req }) => ({ req }),
    }),
    UserModule,
    AuthModule,
    ClientModule,
    GoodsModule,
  ],
  // controllers: [AppController],
  // providers: [AppService],
})
export class AppModule {}
